package MediaEntity;
/*
 *MP4Entity中使用另一个,jar:isoparser
 */

import javafx.scene.media.Media;
import org.mp4parser.IsoFile;


import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;

public class MP4Entity extends MediaEntity{

    public MP4Entity(String filePath){
        this.filePath=filePath;
        File file=new File(filePath);
        try {
            IsoFile t=new IsoFile(file); //isoparser
            fulltime = t.getMovieBox().getMovieHeaderBox().getDuration();
            setName(file.getName());
            this.media=new Media(file.toURI().toURL().toString());
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
}
